package com.example.hrsystem.workflow.model;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.example.hrsystem.data.source.DateTypeConverters;

import java.io.Serializable;
import java.util.Date;

/**
 * 工作流任务实体类
 * 代表流程实例中的一个具体任务节点
 */
@Entity(tableName = "workflow_tasks")
public class WorkflowTask implements Serializable {
    @PrimaryKey(autoGenerate = true)
    private int id;

    // 关联的流程实例ID
    private int processInstanceId;
    
    // 任务名称
    private String name;
    
    // 任务描述
    private String description;
    
    // 任务状态 (PENDING, ASSIGNED, IN_PROGRESS, COMPLETED, REJECTED)
    private String status;
    
    // 任务处理人ID
    private Integer assigneeId;
    
    // 任务创建时间
    @TypeConverters(DateTypeConverters.class)
    private Date createTime;
    
    // 任务分配时间
    @TypeConverters(DateTypeConverters.class)
    private Date assignTime;
    
    // 任务完成时间
    @TypeConverters(DateTypeConverters.class)
    private Date completeTime;
    
    // 任务截止时间
    @TypeConverters(DateTypeConverters.class)
    private Date dueDate;

    // 构造函数
    public WorkflowTask() {}

    // Getter和Setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(int processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getAssigneeId() {
        return assigneeId;
    }

    public void setAssigneeId(Integer assigneeId) {
        this.assigneeId = assigneeId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getAssignTime() {
        return assignTime;
    }

    public void setAssignTime(Date assignTime) {
        this.assignTime = assignTime;
    }

    public Date getCompleteTime() {
        return completeTime;
    }

    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }

    public Date getDueDate() {
        return dueDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }
}